package com.leo.manage_system.service.impl;

import com.leo.manage_system.entity.Announcement;
import com.leo.manage_system.mapper.AdvertiseMapper;
import com.leo.manage_system.mapper.AnnouncementMapper;
import com.leo.manage_system.service.AnnouncementService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 公告 服务实现类
 * </p>
 *
 * @author ${author}
 * @since 2021-11-28
 */
@Service
public class AnnouncementServiceImpl extends ServiceImpl<AnnouncementMapper, Announcement> implements AnnouncementService {
    @Autowired
    private AnnouncementMapper announcementMapper;
    @Override
    public boolean addAnnouncement(Announcement announcement) {
        try{
            announcementMapper.insert(announcement);
        }catch (Exception e) {
            return false;
        }
        return true;
    }

    @Override
    public boolean deleteAnnouncement(String id) {
        try{
            announcementMapper.deleteById(id);
        }catch (Exception e) {
            return false;
        }
        return true;
    }
}
